<extend name="Public:base" />

<block name="content">

    <div class="page-header">
        <a href="{:U('Renovation/addworkcontent')}" class="btn btn-primary">添加就职单位</a>
    </div>

    <table class="table table-striped table-bordered table-hover search-form">
        <thead>
        <th><input name="name" type="text" placeholder="输入名称" value="{:I('name')}" /></th>
        <th>
            <a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Renovation/searchworkcontent')}">查询</a>
        </th>
        </thead>
    </table>

    <div class="row">
        <div class="col-xs-12">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>分类编号</th>
                        <th>分类</th>
                        <th>说明</th>
                        <th>标准参考价</th>
                        <th>贵宾参考价</th>
                        <th>排序</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="work" id="vo">
                        <tr>
                            <td>{$vo.work_id}</td>
                            <td style="text-indent:{$vo['level']*45}px;">{$vo.name}</td>
                            <php>if($vo['parent_id']!=0){</php>
                            <td>{$vo.desc}</td>
                            <td>{$vo.standard_rp}</td>
                            <td>{$vo.honour_rp}</td>
                            <td>{$vo.order}</td>
                            <td>
                                <?php
								switch($vo['status']){
									case '1':
									echo '<span class="green bold">√</span>';
                                break;
                                case '2':
                                echo '<span class="red bold">×</span>';
                                break;
                                }
                                ?>
                            </td>
                            <td>
                                <a href="{:U('Renovation/editworkcontent')}/id/{$vo.work_id}" class="btn btn-xs btn-info" style="margin-right: 10px;float:none;">
                                    <i class="ace-icon fa">编辑</i>
                                </a>
                                <button class="btn btn-xs btn-danger" onclick="" style="margin-right: 10px;float:none;">
                                    <a href="{:U('Renovation/delworkcontent')}/id/{$vo.work_id}" onclick="if(confirm('确定删除?')==false)return false;"/>
                                    <i class="ace-icon fa">删除</i></a>
                                </button>
                            </td>
                        </tr>
                        <php>}</php>
                    </volist>
                    <tr>
                        <td colspan="20" class="page">{$page}</td>
                    </tr>
                    </tbody>

                </table>
            </div>
        </div>
    </div>
</block>
<block name="javascript">
    <script>
        $(function(){

            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input,select').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });


        });
    </script>

</block>